package com.itheima.utils;

import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
@Scope(ConfigurableBeanFactory.SCOPE_SINGLETON)
//@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class LogUtil {
    public LogUtil() {
        System.out.println("对象被创建了");
    }

    @PostConstruct
    private void init(){
        System.out.println("对象被初始化了");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("对象被销毁了");
    }
}
